


#ifndef BOARD_GD32RC663_H
#define BOARD_GD32RC663_H

#define PORTA               0          /**< Port0. */
#define PORTB               1          /**< Port1. */
#define PORTC               2          /**< Port2. */
#define PORTD               3          /**< Port3. */
#define PORTE               4          /**< Port4. */

/******************************************************************
 * Board Pin/Gpio configurations
 ******************************************************************/
//	#define PHDRIVER_PIN_RESET         ((PORTB<<8) | 9)    /**< Reset pin, Port 2, pin5. */
//	#define PHDRIVER_PIN_SSEL			((PORTB<<8) | 0)
//	#define PHDRIVER_PIN_IRQ           ((PORTB<<8) | 12)   /**< Interrupt pin from Frontend to Host, Port2, pin12 */

/******************************************************************
 * PIN Pull-Up/Pull-Down configurations.
 ******************************************************************/
#define PHDRIVER_PIN_RESET_PULL_CFG    PH_DRIVER_PULL_DOWN
#define PHDRIVER_PIN_IRQ_PULL_CFG      PH_DRIVER_PULL_UP
#define PHDRIVER_PIN_NSS_PULL_CFG      PH_DRIVER_PULL_UP

/*****************************************************************
 * Front End Reset logic level settings
 ****************************************************************/
#define PH_DRIVER_SET_HIGH            1          /**< Logic High. */
#define PH_DRIVER_SET_LOW             0          /**< Logic Low. */
#define RESET_POWERDOWN_LEVEL         PH_DRIVER_SET_HIGH
#define RESET_POWERUP_LEVEL           PH_DRIVER_SET_LOW

#define PIN_IRQ_TRIGGER_TYPE    PH_DRIVER_INTERRUPT_FALLINGEDGE  /**< IRQ pin Falling edge interrupt */
#define EINT_PRIORITY           5                /**< Interrupt priority. */
#define EINT_IRQn               EINT3_IRQn       /**< NVIC IRQ */


#endif 

